// import { data } from 'jquery';
import service from '../utils/request.js';

/**
 * 获取活动详情
 * @param {number} id 
 */
export function getActivity(id) {
  return service({
    loadTitle: '加载中...',
    url: 'activity/detail',
    method: 'GET',
    data: {
      id
    }
  })
}
/**获取活动消息
 * @param {object} data
 */
  export function listActivity() {
  return service({
    loadTitle: '加载中...',
    url: 'home/listActivity',
    method: 'GET',
    data
  })
}
/**咨询详情
 */
export function listConsult() {
  return service({
    loadTitle: '加载中...',
    url: 'home/listConsult',
    method: 'GET',
    data
  })
}
/**
 * 获取活动搜索列表
 * @param {string} name 
 * @param {number} page 
 * @param {number} size 
 */
export function getActivitySearchList(name, page, size = 10) {
  return service({
    loadTitle: '搜索中...',
    url: 'activity/search',
    method: 'GET',
    data: {
      name,
      page,
      size
    }
  })
}
/**
 * 获取活动列表
 * @param {array} classifyIds 分类 ids
 * @param {number} page 
 * @param {number} size 
 */
export function getActivityList(classifyIds, page, size = 10) {
  return service({
    loadTitle: '加载中...',
    url: 'cativity/list',
    method: 'GET',
    data: {
      classifyIds,
      page,
      size
    }
  })
}

/**
 * 获取我的活动列表
 */
export function getOwnActivityList() {
  return service({
    loadTitle: '加载中...',
    url: 'activity/own_list',
    method: 'GET'
  })
}

/**
 * 活动嘉宾列表
 * @param {number} activityId	
 */
export function getActivityGuestList(activityId) {
  return service({
    url: 'activity_guest/list',
    method: 'GET',
    data: {
      activityId: activityId
    }
  })
}

/**
 * 获取我的活动报名信息
 * @param {number} activityId 活动id
 */
export function getMyActivityDetail(activityId) {
  return service({
    loadTitle: '加载中...',
    url: 'activity_apply/list',
    method: 'GET',
    data: {
      activityId: activityId
    }
  })
}

/**
 * 活动报名
 * @param {object} data 
 */
export function applyActivity(data) {
  return service({
    loadTitle: '提交中...',
    url: 'activity_apply/create',
    method: 'POST',
    data
  })
}